<?php
class DB_MyConnect {
	private static $conexao = null;
	
	public function __construct($host, $user, $pass, $database){
		if(self::$conexao === null){
			self::$conexao = mysql_connect($host,$user,$pass) or die(mysql_error());
			mysql_select_db($database,self::$conexao) or die(mysql_error());
		}
	}
	
	public function Query($query){
		$result = mysql_query($query,self::$conexao) or die(mysql_error());
		return new DB_MyResult($result);
	}
	
	public function Quote($string){
		return mysql_real_escape_string($string,self::$conexao);
	}
}
?>